package com.yand.jdk8.stream;

import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import static java.util.stream.Collectors.toList;

public class Test1 {



    public static void main(String [] args){
        List<Employee> emps = Arrays.asList(
                new Employee(102, "李四", 59, 6666.66),
                new Employee(101, "张三", 18, 9999.99),
                new Employee(103, "王五", 28, 3333.33),
                new Employee(104, "赵六", 8, 7777.77),
                new Employee(104, "赵六", 8, 7777.77),
                new Employee(104, "赵六", 8, 7777.77),
                new Employee(105, "田七", 38, 5555.55)
        );



        //List<Employee> list = emps.stream().filter((e)->e.getAge()>20).collect(toList());

        //emps.stream().filter((e)->e.getAge()>20).forEach(System.out::println);

        emps.stream().filter((e)->e.getAge()>20).forEach(System.out::println);







    }

}
